home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
madtrb9.arc
/
READFAT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1984-07-13
|
1KB
|
60 lines
PROGRAM readfat;
VAR
fat_fill : ARRAY[0..4095] OF BYTE;
drive : BYTE;
cluster : INTEGER;
fat_cluster : INTEGER;
fat_offset : INTEGER;
free_clusters : INTEGER;
total_clusters: INTEGER;
cl_size : INTEGER;
year,day : INTEGER;
hour,min,
month,date : BYTE;
{$i biosread.inc }
{$i getfree.inc}
{$i getdate.inc}
{$i dumphex.inc}
BEGIN
getdate ( year,month,date,hour,min );
WRITELN( year:5,month:4,date:4,' ',hour:3,min:3);
get_free_space ( free_clusters,total_clusters,cl_size,3);
WRITELN (' free space =',free_clusters:6,total_clusters:6,cl_size:6);
drive := $80;
biosread(fat_fill,drive,0,0,3,8);
cluster := 3;
WHILE cluster <> 2 DO
BEGIN
WRITE('Enter cluster: ');
READLN(cluster);
fat_offset := (cluster*3) DIV 2;
dumphex(fat_fill[fat_offset]);
dumphex(fat_fill[fat_offset+1]);
IF cluster MOD 2 = 0 THEN
fat_cluster := fat_fill[fat_offset] +
( (fat_fill[fat_offset+1] MOD 16 ) * 256)
ELSE
fat_cluster := (fat_fill[fat_offset] SHR 4 ) +
(fat_fill[fat_offset+1] * 16);
dumphex(fat_cluster);
WRITELN( 'Next cluster is : ',fat_cluster);
END;
END.